<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .body{
            width: 100%;
            height: 100%;
            background-color: aqua;
        }
        #app{
            box-sizing: border-box;
            padding: 10px;
            background-color: white;
        }
        #app .title{
            width: 100%;
            height: 50px;
            line-height: 50px;
            font-size: 24px;
        }
        #app .list .item{
            display: flex;
            align-items: center;
            font-size: 14px;
            margin-bottom: 10px;
        }
        #app .list .item .left{
            width: 30%;
        }
        #app .list .item .left img{
            width: 100%;
        }
        #app .list .item .middle{
            margin-left: 4%;
        }
        #app .list .item .right{
            flex: 1;
        }
        #app .list .item .right button{
            float: right;
            margin-right: 20px;
            background-color: red;
            color: white;
            border: none;
            width: 70px;
            height: 22px;
            line-height: 22px;
            border-radius: 10px;
        }
    </style>
</head>


<body>
    <div id="app">
        <div class="title">热门单品</div>
        <div class="list">
            <div class="item" v-for="(item,index) in tasklist" v-bind:key="index">
                <div class="left">
                    <img v-bind:src="item.pic" alt="">
                </div>
                <div class="middle">
                    <div class="name"> {{ item.name }} </div>
                    <div class="desc" style="color: red;"> {{ item.desc }} </div>
                    <div class="money" style="color: red;"> {{ item.money }} </div>
                    <div class="shop" style="color: #ccc;"> {{ item.shop }} </div>
                </div>
                <div class="right">
                    <button> {{ item.status == 1 ? '立即兑' : '' }} </button>
                </div>
            </div>
        </div>
    </div>
</body>

</html>
<script src="./vue-2.5.21.js"></script>
<script>
    //实例化vue对象
    var v = new Vue({
        el: '#app',      //el Vue实力挂载的dom节点
        //data:function(){ return{} }   使用函数的写法，可以在实例化对象时生成一个新的数据
        data: {     //定义响应式数据，data的类型可以是对象，也可以是函数
            tasklist: [
                { id: 1, pic: './images/1.jpg', name: '脐橙3斤 快递到家', desc: '兑换后入手价8.9元', money: '￥10', shop: '适用门店 >', status: 1 },
                { id: 2, pic: './images/2.jpg', name: '粑粑柑2斤 快递到家', desc: '兑换后入手价9.9元', money: '￥30', shop: '适用门店 >', status: 1 },
                { id: 3, pic: './images/3.jpg', name: '水果捞350g', desc: '兑换后入手价6.9元', money: '￥60', shop: '适用门店 >', status: 1 },
            ]
        },
        computed: {},        //computed 定义计算属性
        watch: {},       //watch 定义数据监听
        methods: {},     //methods 定义方法（函数）
        filters: {},     //filters 定义过滤器
        directives: {},      //directives 定义自定义指令
        components: {}       //components 注册局部组件     
    })
</script>